Fixed an issue with intersected abstract properties not requiring to be implemented#56751
Fixed an issue with intersected abstract properties not requiring to be implemented#56751Andarist wants to merge 6 commits intomicrosoft:mainfrom
Conversation
| } | ||
| const result = getIntersectionType(types); | ||
| if (result.flags & TypeFlags.Intersection) { | ||
| (result as IntersectionType).withThisArgumentTarget = intersectionType; |
There was a problem hiding this comment.
The problem that it solves is that getTypeWithThisArgument call for the Bar1 creates a new intersection type, one that doesn't have any reference (through .target or similar) to the "original" intersection (the base type).
So createUnionOrIntersectionProperty creates 2 separate synthetic properties for a for both the base type and the derived type (even though they both refer to the same symbols, declarations, etc). That, in turn, fails derived === base check that is responsible for checking if the property was implemented or not.
This introduces some kind of a link between those types so I can trace this information back through the symbol links.
It's not a super elegant solution but it's the best I was able to figure out. I've tried to cache those property symbols and reuse them between both of those types but that led to a lot of problems. An alternative solution would be to make the mentioned derived === base check smarter but I also failed to figure out how to accurately compare 2 symbols like that.
fixes #56738
fixes #62014